#include<iostream>
using namespace std;
typedef long long LL;
int x, y;
int main()
{
	int t = 1;
	while (cin >> x >> y) {
		LL cnt = 0;
		for (int i = x; i <= 1100; i++) {
			bool flag = 0;
			for (int j = x; j <= 1100; j++) {
				LL res = i * i * i + j * j * j;
				//cout << "res==" << res << endl;
				/*if (res >= y * 100) {
					flag = 1;
					break;
				}*/
				LL ans1 = res / 10;
				if (res % 10 == 3 && ans1 <= y)cnt++;
			}
			//if (flag)break;
		}
		cout << "Case " << t++ << ": " << cnt << endl;
	}
	return 0;
}